package com.aote.model.table.datasprocessor;

import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import com.aote.mvc.event.ActionFactory;
import com.browsesoft.htmlcomponent.HTMLBasicComponent;

/**
 * 调用动作类的初始化数据处理器 动作配置在改组件元素内
 * 
 */
public class CallActionDatasProcessor implements InitDatasProcessor {

	public void process(HttpServletRequest request,
			HTMLBasicComponent component, List datas) {
		// 得到动作类配置
		String action = component.getElement().getAttribute("action");
		ActionFactory af = new ActionFactory(component);
		// 对每一条数据都进行此处理
		Iterator iter = datas.iterator();
		while (iter.hasNext()) {
			Map data = (Map) iter.next();
			af.doAction(action, request, data);
		}
	}
}
